package com.xc.c1

object exception1 {

  def main(args: Array[String]): Unit = {
//    x1()
    x2()
  }

  def x1(): Unit = {
    try {
      10 / 0
    } catch {
      case ex: Exception => println(ex.getClass.getName + ":" + ex.getMessage)
      case ex: ArithmeticException => println("ArithmeticException : " + ex.getMessage) //不会执行
    } finally {
      println("finally")
    }

    println("------end-------")
  }

  @throws(classOf[ClassNotFoundException])
  def x2()={
    println("exception")
  }

}
